package task13;

import java.util.HashMap;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/27 10:29
 * @description:
 */
public class DictionaryDaoHashMap implements DictionaryDao{
  HashMap<String,String>hashMap=new HashMap<String,String>();

  @Override
  public void add(MyDictionary d) {
    hashMap.put(d.getEnglish(),d.getChinese());

  }

  @Override
  public String query(String english) {

      if (hashMap.containsKey(english)) {
        return hashMap.get(english);
      }
    return null;
  }
}
